package server;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.List;

import bean.Cliente;
import business.ClienteBusiness;
import common.ICliente;

public class ClienteImpl extends UnicastRemoteObject implements ICliente
{
	
	private static final long serialVersionUID = 1L;

	public ClienteImpl() throws RemoteException {
		super();
	}

	@Override
	public int cadastrar(Cliente cliente) throws RemoteException 
	{
		return ClienteBusiness.getInstance().salvar(cliente);
	}

	@Override
	public List<Cliente> buscarPorNome(String nomeCliente) throws RemoteException {
		
		return ClienteBusiness.getInstance().buscarPorNome(nomeCliente);
	}

	@Override
	public Cliente buscarPorId(Integer idCliente) throws RemoteException {
		return ClienteBusiness.getInstance().buscarPorId(idCliente);
	}

	@Override
	public List<Cliente> buscarPorInfracoes(Integer min, Integer max) throws RemoteException {
		return ClienteBusiness.getInstance().buscarPorInfracoes(min, max);
	}

	@Override
	public int atualizar(Cliente cliente) throws RemoteException {
		return ClienteBusiness.getInstance().atualizar(cliente);
	}

	@Override
	public int excluir(Cliente cliente) throws RemoteException {
		return ClienteBusiness.getInstance().excluir(cliente);
	}
}
